<%
Dim conn
Dim rs
Dim sqlcount
Dim getcount
F_RF_BILL_ID = Request.Form.Item("F_RF_BILL_ID")
F_CODE = Request.Form.Item("F_CODE")
F_RF_CUSTOMER_FR_ID = Request.Form.Item("F_RF_CUSTOMER_FR_ID")
F_RF_CUSTOMER_TO_ID = Request.Form.Item("F_RF_CUSTOMER_TO_ID")
F_RF_WHOUSE1_ID = Request.Form.Item("F_RF_WHOUSE1_ID")
F_RF_WHOUSE2_ID = Request.Form.Item("F_RF_WHOUSE2_ID")

F_RF_BILL_ID = Replace(F_RF_BILL_ID,"'","")
F_CODE = Replace(F_CODE,"'","")
F_RF_CUSTOMER_FR_ID = Replace(F_RF_CUSTOMER_FR_ID,"'","")
F_RF_CUSTOMER_TO_ID = Replace(F_RF_CUSTOMER_TO_ID,"'","")
F_RF_WHOUSE1_ID = Replace(F_RF_WHOUSE1_ID,"'","")
F_RF_WHOUSE2_ID = Replace(F_RF_WHOUSE2_ID,"'","")
set conn = Server.Createobject("ADODB.Connection")
set  rs = Server.Createobject("ADODB.Recordset")
ConnStr = "DSN=dbpr_sql;UID=sa;PWD=hhhhhhhh;"
conn.Mode = 3
conn.Open (ConnStr)
sqlcount = "SELECT MAX() as numlines FROM TRANSBILL"
set rs = conn.execute(sqlcount)
getcount = rs.fields("numlines")
Session("tablecount") = getcount
Session("Tablename") = Session("Tablename") 
Session("fieldname") = Session("fieldname")
SQL="INSERT INTO TRANSBILL(RF_BILL_ID,CODE,RF_CUSTOMER_FR_ID,RF_CUSTOMER_TO_ID,RF_WHOUSE1_ID,RF_WHOUSE2_ID) VALUES(" & F_RF_BILL_ID & "," & "'" & F_CODE & "'" & "," & F_RF_CUSTOMER_FR_ID & "," & F_RF_CUSTOMER_TO_ID & "," & F_RF_WHOUSE1_ID & "," & F_RF_WHOUSE2_ID  & ")"
set rs = conn.execute(SQL)
conn.close
set rs = Nothing
set conn = Nothing
Response.redirect("INS_TRANSBILL1.asp")
%>
